<template>
	<view class="volunteer">
		<view class="volunteer-swiper">
			<u-swiper :list="imgList" height="284" border-radius='0'></u-swiper>
		</view>
		
		<view class="volunteer-tabar">
			<view class="volunteer-tabar-item volunteer-tabar-item1" @click="goto('../pages/chooseUniversity')">
				选大学<image src="../../static/university.png" mode=""></image>
			</view>
			<view class="volunteer-tabar-item" @click="goto('../pages/chooseMajor')">
				选专业<image src="../../static/zhuanye.png" mode=""></image>
			</view>
			<view class="volunteer-tabar-item volunteer-tabar-three">
				专业选择测评
				<view class="volunteer-tabar-tabs">发现适合自己的专业</view>
			</view>
			<view class="volunteer-tabar-item" @click="goto('../pages/studentPlan')">
				招生计划<image src="../../static/jihua.png" mode=""></image>
			</view>
		</view>
		
		<view class="volunteer-info">
			<view class="volunteer-info-title"> 2020年高考录取概率已全部更新（全国28省）</view>
			<view class="volunteer-info-list">
				<view class="volunteer-info-item" @click="goto('../pages/enterTime')">
					<image src="../../static/richeng.png" mode=""></image>
					<view>录取日程</view>
				</view>
				<view class="volunteer-info-item" @click="goto('../pages/schoolList')">
					<image src="../../static/paihang.png" mode=""></image>
					<view>高校排行</view>
				</view>
				<view class="volunteer-info-item" @click="goto('../pages/gaokaochengji')">
					<image src="../../static/chengjiu.png" mode=""></image>
					<view>高考成绩</view>
				</view>
				<view class="volunteer-info-item" @click="goto('../pages/historyNum')">
					<image src="../../static/pici.png" mode=""></image>
					<view>历年批次线</view>
				</view>
				<view class="volunteer-info-item" @click="goto('../pages/oneNum')">
					<image src="../../static/fenduan.png" mode=""></image>
					<view>一分一段</view>
				</view>
				<view class="volunteer-info-item volunteer-info-item1" @click="goto('../pages/seeUniversity')">
					<image src="../../static/university.png" mode=""></image>
					<view>全景看大学</view>
				</view>
			</view>
		</view>
		
		<view class="volunteer-work" @click="goto('../pages/summerWork')">
			暑假工报名
			<view>月均收入4500元起，包吃住</view>
			<image src="../../static/lou.png" mode=""></image>
		</view>
		
		<view class="volunteer-see">
			<view class="volunteer-see-title">
				大家都在看 <view @click="goto('../pages/videoList')">查看更多 <u-icon name="arrow-right" class="arrow-right"></u-icon></view>
			</view>
			<view class="volunteer-see-list">
				<view class="volunteer-see-item" v-for="(item,i) in vList" :key="i" @click="goto('../pages/videoDetail', item)">
					{{item.videoName}}
					<view><image src="../../static/play.png" mode=""></image></view>
				</view>
			</view>
		</view>
		
		<view class="volunteer-zixun">
			<view class="volunteer-zixun-title">
				为您精选资讯 <view @click="goto('../pages/newsList')">查看更多 <u-icon name="arrow-right" class="arrow-right"></u-icon></view>
			</view>
			<view class="volunteer-zixun-list">
				<view class="volunteer-zixun-item" v-for="(item,i) in nList" :key="i" @click="goto('../pages/newsDetail', item)">
					<view class="volunteer-zixun-item-left">
						<view class="volunteer-zixun-item-text" v-html="item.title"></view>
						<view class="volunteer-zixun-item-text1">数据看板 {{item.createdAt}}</view>
					</view>
					<u-lazy-load :image="item.thumb" class="img"></u-lazy-load>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import api from 'utils/api.js'
	export default {
		data() {
			return {
				imgList: [
					'https://img9.51tietu.net/pic/2019-091200/vgkpidei2tjvgkpidei2tj.jpg',
					'https://img9.51tietu.net/pic/2019-091200/euzekmi5m23euzekmi5m23.jpg',
					'https://img9.51tietu.net/pic/2019-091200/143tt0ta4sr143tt0ta4sr.jpg',
					'https://img9.51tietu.net/pic/2019-091200/ff1vqwm3q33ff1vqwm3q33.jpg'
				],
				vList: [],
				nList: []
			}
		},
		onLoad() {
			this.videoList();
			this.newsList();
		},
		methods: {
			goto(name, obj) {
				uni.navigateTo({
					url: name
				});
				uni.setStorageSync('news',obj);
			},
			videoList() {
				this.http({
					url:`${api.ServerUrlW}api/v1/article/videoList?pageNum=1&pageSize=3`,
					method:'GET',
					success: res=> {
						if(res.code == 0){
							this.vList = res.result;
						}
					}
				})
			},
			newsList() {
				this.http({
					url:`${api.ServerUrlW}api/v1/article/newsList?pageNum=1&pageSize=3`,
					method:'GET',
					success: res=> {
						if(res.code == 0){
							this.nList = res.result;
						}
					}
				})
			}
		}
	}
</script>

<style lang="less">
	page{
		background-color: #F5F5F5;
	}
	.volunteer{
		// height: 100%;
		background-color: #F5F5F5;
		.volunteer-tabar {
			padding: 30rpx;
			padding-bottom: 14rpx;
			overflow: hidden;
			.volunteer-tabar-item {
				float: left;
				width: calc(50% - 15rpx);
				text-align: center;
				background-color: #FFFFFF;
				height: 120rpx;
				border-radius: 20rpx;
				margin-bottom: 16rpx;
				padding-top: 40rpx;
				image {
					width: 38rpx;
					height: 38rpx;
					vertical-align: bottom;
					margin-left: 10rpx;
				}
			}
			.volunteer-tabar-item:nth-child(even){
				margin-left: 28rpx;
			}
			.volunteer-tabar-item1 {
				line-height: 1.6;
				padding-top: 36rpx;
				image {
					width: 50rpx;
					height: 50rpx;
				}
			}
			.volunteer-tabar-three {
				padding-top: 24rpx;
				.volunteer-tabar-tabs {
					font-size: 24rpx;
					color: #c6c6c6;
				}
			}
		}
		.volunteer-info {
			margin: 30rpx;
			margin-top: 0;
			background-color: #FFFFFF;
			.volunteer-info-title {
				height: 90rpx;
				line-height: 90rpx;
				padding-left: 30rpx;
				border-bottom: 1px solid #F1F1F1;
			}
			.volunteer-info-list{
				padding-bottom: 50rpx;
				.volunteer-info-item {
					display: inline-block;
					width: 33.33%;
					text-align: center;
					font-size: 26rpx;
					padding-top: 40rpx;
					image {
						width: 50rpx;
						height: 50rpx;
					}
				}
				.volunteer-info-item1 {
					margin-top: 30rpx;
					image {
						width: 70rpx;
						height: 70rpx;
					}
				}
			}
		}
		.volunteer-work {
			font-size: 40rpx;
			margin: 0 30rpx;
			background-color: #FFFFFF;
			padding: 30rpx 40rpx;
			position: relative;
			>view {
				font-size: 26rpx;
				margin-top: 6rpx;
				color: #a3a3a3;
			}
			image {
				position: absolute;
				right: 30rpx;
				top: 38rpx;
				width: 80rpx;
				height: 80rpx;
			}
		}
		.volunteer-see {
			padding: 30rpx;
			.volunteer-see-title {
				>view {
					float: right;
					font-size: 26rpx;
					color: #c6c6c6;
					.arrow-right {
						margin-left: 4rpx;
					}
				}
			}
			.volunteer-see-list {
				display: flex;
				width: 100%;
				height: 208rpx;
				margin-top: 10rpx;
				overflow-x: auto;
				.volunteer-see-item {
					display: inline-block;
					flex-shrink: 0;
					width: 60%;
					height: 200rpx;
					margin-right: 30rpx;
					background-color: #dedede;
					position: relative;
					text-align: center;
					font-size: 36rpx;
					color: #fc5531;
					text-shadow: 0px 2px 2px #fb8f78;
					padding: 50rpx 20rpx;
					border-radius: 10rpx;
					view {
						width: 80rpx;
						height: 80rpx;
						background-color: rgba(0,0,0,.3);
						border-radius: 50%;
						transform: translate3d(-50%, -50%, 0);
						position: absolute;
						top: 50%;
						left: 50%;
						image {
							width: 60%;
							height: 60%;
							margin-left: 20%;
							margin-top: 20%;
						}
					}
				}
			}
			.volunteer-see-list::-webkit-scrollbar{
			  width: 0;
			  height: 0;
			  color: transparent;
			}
		}
		.volunteer-zixun {
			background-color: #FFFFFF;
			.volunteer-zixun-title {
				height: 90rpx;
				line-height: 90rpx;
				padding: 0 30rpx;
				border-bottom: 1px solid #F1F1F1;
				>view {
					float: right;
					font-size: 26rpx;
					color: #c6c6c6;
					.arrow-right {
						margin-left: 4rpx;
					}
				}
			}
			.volunteer-zixun-list {
				.volunteer-zixun-item {
					padding: 20rpx 30rpx;
					border-bottom: 1px solid #F1F1F1;
					.volunteer-zixun-item-left {
						display: inline-block;
						width: calc(100% - 130rpx);
						padding-top: 2rpx;
						padding-right: 10rpx;
						.volunteer-zixun-item-text {
							font-size: 30rpx;
							display: -webkit-box;
							-webkit-box-orient: vertical;
							-webkit-line-clamp: 2;
							overflow: hidden;
						}
						.volunteer-zixun-item-text1 {
							font-size: 24rpx;
							color: #c6c6c6;
							margin-top: 12rpx;
						}
					}
					.img {
						float: right;
						width: 130rpx;
						height: 128rpx;
					}
				}
				.volunteer-zixun-item:last-child {
					border: none;
				}
			}
		}
	}
</style>
